from os.path import join 
from os import getcwd

import xlsxwriter

from checks import no_job_trud

xlsx_file = join(getcwd(), "no_job_trud.xlsx")

records = no_job_trud()

heads=['Ceh', 'Uch', 'Zak', 'Nchert', 'Kol_det', 'Nomnom', 'N_opr5', 'Normar', 'Chist', 'Chern', 'Tst', 'Tpz', 'Cena']
#heads=['typ_rec', 'ved_sklad', 'nom_nom', 'sklad', 'blk_no', 'ceh', 'bal_ch', 'zak', 'prichina', 'vinovnik', 'ei', 'r1', 'cen_zav', 'r2', 'vo', 'kol', 'r3', 'sum_zav', 'r5', 'ost_ksu', 'r7', 'sum_post', 'r8', 'sum_chet', 'cor_shet', 'r9', 'kol_tn', 'r10', 'cen_post', 'res1', 'res2', 'kol_d', 'sum_d', 'kol_i', 'sum_i', 'n_ksu', 'ost_ksud', 'r_ost']
workbook = xlsxwriter.Workbook(xlsx_file)
worksheet = workbook.add_worksheet()
lh=len(heads)
lr=len(records)
for x in range(lh):
	worksheet.write(0, x, heads[x])
for y in range(lr):
	for z in range(lh):
		worksheet.write(1+y, z, records[y][z])
workbook.close()